$(function() {
	$('#vue_vm_list div').hide();
});

findAll();

function findAll() {
	if($('#vue_vm_list').length==0) {return;}
	$('#vue_vm_list div').hide();
    var user = getLoginedUser().subjectRoomId;
    var subjectRoomId;
    if(user.userLevel==1){
        subjectRoomId = null;
	}else {
        subjectRoomId = user.subjectRoomId;
	}
	find_basic_by_json(path+'/elderOutOrder/findAll', {status:0,subjectRoomId:subjectRoomId},function(response) {
		$('#vue_vm_list').html(gl_vue_vm_list_html);
		
		new Vue({
			el: '#vue_vm_list',
			data: {
				todos: response.data
			},
			methods: {
				getChepingUrl:function(elderId, elderName, elderCardId) {
					return getChepingUrl(elderId, elderName, elderCardId);
				}
			}
		});
		
		$('#vue_vm_list div').show();
	});
}

function setCheck() {
    var beHospitalId = $('input:radio[name="elderId"]:checked').attr('beHospitalId');
    if(!beHospitalId){
        alert('请先选择要操作的数据');
        return;
	}
    save_basic_by_json(path+'/elderOutOrder/setCheck', {beHospitalId: beHospitalId}, function() {
        alert('保存成功');
        findAll();
    });
}